<template>
	<div class="uiue-card" style="flex: 1">
		<div class="tit" style="margin-bottom: 10px">审批记录</div>
		<a-table :dataSource="datas" :columns="columns" :pagination="false">
			<template #bodyCell="{ column, record }">
				<template v-if="column.dataIndex === 'modifyDate'">
					<span>
						{{ record.modifyDate ? dayjs(record.modifyDate).format('YYYY-MM-DD HH:mm:ss') : '' }}
					</span>
				</template>
				<template v-if="column.dataIndex === 'createDate'">
					<span>
						{{ record.createDate ? dayjs(record.createDate).format('YYYY-MM-DD HH:mm:ss') : '' }}
					</span>
				</template>
				<template v-if="column.dataIndex === 'wfTime'">
					<span>
						{{ record.wfTime ? dayjs(record.wfTime).format('YYYY-MM-DD HH:mm:ss') : '' }}
					</span>
				</template>
				
			</template>
		</a-table>
	</div>
</template>

<script setup name="ProcessHistory">
import dayjs from 'dayjs'

const props = defineProps({
	datas: {
		type: Array
	}
})

const columns = [
	{
		title: '序号',
		width: 80,
		align: 'center',
		customRender: ({ text, record, index }) => {
			return `${index + 1}`
		}
	},
	{
		title: '处理人',
		width: 120,
		dataIndex: 'wfActor',
		align: 'center'
	},
	{
		title: '部门',
		dataIndex: 'wfActorDept',
		align: 'center'
	},
	{
		title: '审批环节',
		dataIndex: 'taskName',
		align: 'center'
	},
	{
		title: '处理意见',
		dataIndex: 'auditIdea',
		align: 'center'
	},
	{
		title: '接收时间',
		dataIndex: 'createDate',
		align: 'center'
	},
	{
		title: '完成时间',
		dataIndex: 'wfTime',
		align: 'center'
	}
]
</script>

<style lang="less" scoped></style>
